package day04;

public class Deque {
    static int N = 1000000 + 500;
    static int[] Q = new int[N];
    static int head = N / 2;
    static int tail = N / 2 - 1;

    public static void main(String[] args) {
        for(int i=0;i<10;i++){
            if(i%2==1){
                Q[++tail]=i;
            }else{
                Q[--head]=i;
            }
        }

//        while(head<=tail){
//            System.out.print(Q[head]);
//            head++;
//        }
        while(head<=tail){
            System.out.println(Q[tail--]);

        }

    }




}
